<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>for...in遍历对象的属性</title>
</head>

<body>
    <script type="text/javascript">
        var x
        var books = new Array()
        books[0] = "《JavaScript前端开发案例教程》"
        books[1] = "《Node.js核心基础教程》"
        books[2] = "《HTML5移动Web开发》"
        for (x in books) {
            document.write(books[x] + "<br />")
        }
    </script>
</body>

</html>